package org.cloud.jiangyoucommon.enums;

/**
 * 服务端响应结果-状态枚举类
 */
public enum HttpStatusEnum implements IStatusInfo {
    SUCCESS(200,"请求成功"),
    BODY_NOT_MATCH(400,"数据格式不匹配"),
    NOT_FOUND(404,"访问资源不存在"),
    UNAUTHORIZED(401,"未认证"),
    INTERNAL_SERVER_ERROR(500,"服务器内部错误"),
    SERVER_BUSY(503,"服务器正忙，请稍后再试"),
    REQUEST_METHOD_SUPPORT_ERROR(10001,"当前请求方法不支持"),
    REQUEST_PARAMETER_NULL(10002,"当前请求参数为空！"),
    USER_NOT_EXISTS(10003,"该用户不存在！"),
    USER_INVALID(10004,"当前登录信息已失效，请重新登录！"),
    USERNAME_OR_PASSWORD_ERROR(10005,"账号或密码错误"),
    USER_NAME_LOCK(10006,"该账号已被锁定！"),
    FILE_UPLOAD_FAIL(10008,"文件上传失败！"),
    USER_ALREADY_EXISTS(10007,"该用户已存在！");

    /**
     * 错误信息码
     */
    private Integer code;

    /**
     * 错误提示信息
     */
    private String message;

    HttpStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
